package com.llpy.controller;

import com.llpy.Service.ManageService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class DataController {
    private final ManageService manageService;

    public DataController(ManageService manageService) {
        this.manageService = manageService;
    }

    //用户分页
    @GetMapping("/userData")
    public Page<?> getUserPage(Pageable pageable) {
        return manageService.findUserAll(pageable);
    }

    //歌曲分页
    @GetMapping("/userSong")
    public Page<?> getSongPage(Pageable pageable) {
        return manageService.findSongAll(pageable);
    }

    //评论分页
    @GetMapping("/userComment")
    public Page<?> getCommentPage(Pageable pageable) {
        return manageService.findCommentAll(pageable);
    }

}